package com.imooc.courselist.controller;

import com.imooc.courselist.CourseListApplication;
import com.imooc.courselist.entity.Course;
import com.imooc.courselist.service.CourseListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: 课程列表控制器
 */
@RestController
public class CourseListController {
    @Autowired
    CourseListService courseListService;

    @GetMapping("/courses")
    public List<Course> courseList() {
        return courseListService.courseList();
    }
}
